package com.web.utils;

/**
 * Created by xukk on 2017/6/24.
 */
public class MyObjects {
    public static Integer defaulInteger(Integer a){
        if(a==null) return 0;
        else return a;
    }
    public static Integer calcutePage(Integer start,Integer lengh){
        if(start==null) start=0;
        Integer page=0;
        if(start>0){
            int a =start/ lengh;
            int b = start % lengh;
            if (b == 0)
                page = a;
            else if (b > 0)
                page = a + 1;
        }
        return page;
    }
    public static Boolean patternST(String status,Boolean enabled){
        if(status.equals("start"))
            return true;
        if(status.equals("stop"))
            return false;
        return enabled;
    }
}
